package com.tiheima.utils;

/**
 *  ThreadLocal 工具类数据共享
 */
public class ThreadLocalUtil {

    // 构造器私有化
    private ThreadLocalUtil() {}

    private static final ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    // 存
    public static void set(Integer id) {
        threadLocal.set(id);
    }

    // 取
    public static Integer get() {
        return threadLocal.get();
    }

    // 删
    public static void remove() {
        threadLocal.remove();
    }

}
